class UsersController < ApplicationController
  before_filter :login_required
  
  def index
    @user = current_user
    page = params[:page] || 1
    @pdsessions = @user.pdsessions.paginate :page => page, :order => 'start DESC'
  end
  
  def update
    @user = current_user
    if @user.update_attributes(params[:user])
      flash[:notice] = 'Goal was successfully updated.'
    else
      flash[:notice] = 'There was an error.'
    end
    redirect_to(users_path)
  end
  
end
